package com.sunnada.edu.business.contracTemplate.service;

import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sunnada.edu.business.contracTemplate.dao.ContracTemplateDao;
import com.sunnada.edu.system.pub.common.EXCELObject;
import com.sunnada.edu.system.pub.util.DateUtil;

@Service
@Transactional
public class ContracTemplateServiceImpl implements ContracTemplateService {
	private static final Logger logger = LoggerFactory.getLogger(ContracTemplateServiceImpl.class);
	@Resource
	ContracTemplateDao contracTemplateDao;

	
	@Override
	public int getContracTemplateCots(HashMap<String, String> params) {
		return contracTemplateDao.getContracTemplateCots(params);
	}

	@Override
	public List<?> findContracTemplate(HashMap<String, String> params) {
		return contracTemplateDao.findContracTemplate(params);
	}
	@Override
	public String contracTemplateDelete(HashMap<String, String> params) {
		String msg = "";
		int num = contracTemplateDao.contracTemplateDelete(params);
		if (num == 0) {
			msg = "删除失败!";
		}
		return msg;
	}

	@Override
	public String contracTemplateAdd(HashMap<String, String> params) {
		String msg = "";
			int num = contracTemplateDao.contracTemplateAdd(params);
			if (num == 0) {
				msg = "0";// 失败
			} else {
				msg = "1";// 成功
			}

		return msg;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String contracTemplateUpdate(HashMap<String, String> params) {
		String msg = "";
			int num = contracTemplateDao.contracTemplateUpdate(params);
			if (num == 0) {
				msg = "0";// 失败
			} else {
				msg = "1";// 成功
			}
		return msg;
	}

	@Override
	public Map contracTemplateById(HashMap<String, String> params) {
		return contracTemplateDao.contracTemplateById(params);
	}

}
